package com.marktotop.validation;

import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.constraints.NotNull;
import java.lang.annotation.*;

/**
 * IsMobile 自定义注解验证手机号码格式是否正确
 *
 * @author WXLD
 * @Data 2021/6/18
 * @Since 1.0
 */
@Target({ElementType.METHOD,ElementType.ANNOTATION_TYPE,ElementType.FIELD,ElementType.CONSTRUCTOR,ElementType.PARAMETER,ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = { IsMobileValidator.class })
public @interface IsMobile {

    boolean required() default true;

    String message() default "{手机号码格式错误！}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
